package com.web.dao;

import com.web.entity.LogVersion;
import com.web.entity.LogVersionExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

/**
 * @author FDjavaone
 */
public interface LogVersionMapper {
    @SelectProvider(type=LogVersionSqlProvider.class, method="countByExample")
    int countByExample(LogVersionExample example);

    @DeleteProvider(type=LogVersionSqlProvider.class, method="deleteByExample")
    int deleteByExample(LogVersionExample example);

    @Delete({
        "delete from t_log_version",
        " where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into t_log_version (id, min_version, ",
        " max_version, platform, ",
        " down_load_url, description, ",
        " create_time, modify_time)",
        " values (#{id,jdbcType=INTEGER}, #{minVersion,jdbcType=VARCHAR}, ",
        " #{maxVersion,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, ",
        " #{downLoadUrl,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, ",
        " #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP})"
    })
    int insert(LogVersion record);

    @InsertProvider(type=LogVersionSqlProvider.class, method="insertSelective")
    int insertSelective(LogVersion record);

    @SelectProvider(type=LogVersionSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="min_version", property="minVersion", jdbcType=JdbcType.VARCHAR),
        @Result(column="max_version", property="maxVersion", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform", property="platform", jdbcType=JdbcType.VARCHAR),
        @Result(column="down_load_url", property="downLoadUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="modify_time", property="modifyTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<LogVersion> selectByExample(LogVersionExample example);

    @Select({
        "select",
        " id, min_version, max_version, platform, down_load_url, description, create_time, ",
        " modify_time",
        " from t_log_version",
        " where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="min_version", property="minVersion", jdbcType=JdbcType.VARCHAR),
        @Result(column="max_version", property="maxVersion", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform", property="platform", jdbcType=JdbcType.VARCHAR),
        @Result(column="down_load_url", property="downLoadUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="modify_time", property="modifyTime", jdbcType=JdbcType.TIMESTAMP)
    })
    LogVersion selectByPrimaryKey(Integer id);

    @UpdateProvider(type=LogVersionSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") LogVersion record, @Param("example") LogVersionExample example);

    @UpdateProvider(type=LogVersionSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") LogVersion record, @Param("example") LogVersionExample example);

    @UpdateProvider(type=LogVersionSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(LogVersion record);

    @Update({
        "update t_log_version",
        " set min_version = #{minVersion,jdbcType=VARCHAR},",
          " max_version = #{maxVersion,jdbcType=VARCHAR},",
          " platform = #{platform,jdbcType=VARCHAR},",
          " down_load_url = #{downLoadUrl,jdbcType=VARCHAR},",
          " description = #{description,jdbcType=VARCHAR},",
          " create_time = #{createTime,jdbcType=TIMESTAMP},",
          " modify_time = #{modifyTime,jdbcType=TIMESTAMP}",
        " where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(LogVersion record);
}